<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<script type="text/javascript">
    $(document).ready(function() {
        var fm1 = ["form1", "child_container", "form1Id"];
        Page.createForm(fm1);
        TempUtil.render('child_template', 'form1',DOC);
        Page.setStripeTable();   
            var $btnExportConfig = $('#btnExportConfig');
            $btnExportConfig.bind('click', function() {
                Page.postJSON({
                    $id: $btnExportConfig,
                    json: { cmd: RequestCmd.CONFIG_EXPORT },
                    success: function(data) {
                        var url = '/html/export_config';
                        $('#exportDelegate').text(DOC.link.clickMeDownload).prop("href", url).show();
                    }
                });
            });

        

        var $btnLoadConfig = $('#btnLoadConfig');
        $btnLoadConfig.bind('click', function() {
           SysUtil.upload2($('#form1'), $('#configFile'), "system", function(fileName) {
                theUpdateFileName = fileName;
                closeBox();
            }); 
        });

        $('#form1').attr({
            "enctype": "multipart/form-data",
            "method": "post"
        });

    });
</script>

<div class="tab_box" id="child_container">
    <div id="form1Id">
        <script type="text/template" id="child_template">
            <!-- <form id="form1" enctype="multipart/form-data" method="post"> -->
                <table class="detail" cellspacing="0">
                    <tr id="trExportConfig">
                        <th><%- sys.exportCfg %><%- colon %></th>
                        <td>
                            <input type="button" id="btnExportConfig" value="<%- btn.exportCfg %>"/><a id="exportDelegate" style="display:none;"></a>
                        </td>
                    </tr>
                    <tr>
                        <th><%- sys.selectCfgFile %><%- colon %></th>
                        <td>
                            <input type="file" id="configFile" name="configFile" style="display:none;" onchange=filepath.value=this.value>
                            <input type="textfield" id="filepath">
                            <input type="button" id="filebutton" value="<%- btn.browse %>" onclick="configFile.click()">
                            <input type="button" id="btnLoadConfig" value="<%- btn.loadCfg %>"/>
                        </td>
                    </tr>
                </table>
            <!-- </form> -->
        </script>
    </div>
</div>

